#include <iostream>

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    int drink[10001] = {0};
    int tmp;
    for (int i=1; i<=n; ++i)
    {
        cin >> tmp;
        drink[tmp]++;
    }
    int ans = n / 2;
    if (n%2 == 1) ans += 1;
    for (int i=1; i<=k; ++i)
    {
        if (drink[i]/2) ans += drink[i]/2;
    }
    cout << ans;
    return 0;
}
